package practice._misc

/**
  * Created by lovepocky(lovepocky@foxmail.com) on 2016/4/13.
  */
object DependencyInjection {
	def main(args: Array[String]) {
		
	}
	
	/**
	  * Dependency Injection
	  * example:http://hongjiang.info/scala-self-type-and-di/
	  */
	class example1 {
		val testmain = new testmain
		
		trait User {
			def name: String
		}
		
		trait B {
			outer: User =>
			def foo: Unit = {
				println(name)
			}
		}
		
		class testmain extends B with User {
			def name: String = ???
			
		}
		
	}
	
}
